import static org.junit.Assert.*;
import org.junit.*;

public class KonwerterTest_JUnit4 
{

	int number;
	Konwerter konwerter;

	@Before
	public void before()
	{
		number=(int)((Math.random()+0.001)*100);
		konwerter = new Konwerter(number);
	}

	@After
	public void after()
	{
		konwerter = null;
	}
	
	@Ignore
	public void ignore()
	{
		//This method wont be used;
	}
	
	@Test(expected = IndexOutOfBoundsException.class)
	public void testKonwertuj1()
	{
		for(int i=2;i<=17;i++)
		{
			assertEquals(konwerter.konwertuj(i),Integer.toString(number, i));
		}
	}
	
	@Test(timeout = 10)
	public void testKonwertuj2()
	{
		for(int i=2;i<=16;i++)
		{
			assertEquals(konwerter.konwertuj(i),Integer.toString(number, i));
		}
	}
}